package com.design.observer.gper;

public class Test {


    public static void main(String[] args) {
        GPer gPer = GPer.getInstance();
        Teacher tom = new Teacher("Tom");
        Teacher jerry = new Teacher("jerry");
        gPer.addObserver(tom);
        gPer.addObserver(jerry);

        // 用户行为
        Question question = new Question();
        question.setUserName("张三");
        question.setContent("观察者模式适用于哪些场景？");

        gPer.publishQuestion(question);
    }
}
